package hl.crazy_java.chapter_17;

import java.io.IOException;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.net.*;
import java.util.Scanner;

/**
 * 
 * @author Liu Huan
 */


public class Server {
    public static void main(String[] args) throws IOException {
//        Scanner sc = new Scanner(System.in);
//        var str = sc.hasNext();
//        ps.println(str);

        var ss = new ServerSocket(30000);
        while (true) {
            System.out.println("111");
            Socket s = ss.accept();
            System.out.println("222");
            var ps = new PrintStream(s.getOutputStream());
            ps.println("hjljoijoij");

            ps.close();
            s.close();

        }

    }
    
}
